﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RMonitoreoTickets.aspx.cs"
    Inherits="consultas_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Resultado De Consulta</title>
    <link href="../imp_site.css" rel="stylesheet" type="text/css" />
    <link href="../site.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <div>
            &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            <table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">
                <tr>
                    <td style="width: 870px; height: 78px;">
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td width="60%" style="height: 59px">
                                    <img src="../images/logo.jpg" /></td>
                                <td align="right" valign="bottom" width="40%" style="height: 59px">
                                    <table align="right" border="0" cellpadding="0" valign="bottom" width="100%">
                                        <tr>
                                        </tr>
                                        <tr>
                                            <td align="left" class="txt_imp">
                                                Fecha de emisión de la consulta :</td>
                                            <td align="right" class="txt_imp">
                                                <%=DateTime.Now.ToShortDateString()%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="txt_imp">
                                                Hora de emisión de la consulta:</td>
                                            <td align="right" class="txt_imp">
                                                <%=DateTime.Now.ToShortTimeString()%>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="width: 870px" valign="top">
                        <hr class="txt_linea" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 870px" valign="top">
                        <table align="center" border="0" cellpadding="0" cellspacing="0" valign="top" width="100%">
                            <tr>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="width: 870px">
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="80%">
                            <tr>
                                <td align="center" class="txt_tit">
                                    Resultado de la consulta</td>
                            </tr>
                            <tr>
                                <td align="center" class="txt_tit">
                                    Fecha seleccionada</td>
                            </tr>
                            <tr>
                                <td align="center" class="txt_tit" style="height: 14px">
                                    <%=Session["Fecha_ini"]%>
                                    a
                                    <%=Session["Fecha_fin"]%>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" class="txt_tit">
                                    &nbsp;&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </div>
        &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <table align="center">
            <tr>
                <td style="text-align: center">
            <asp:Panel ID="pnlExportar" runat="server">
                <table align="center">
                    <tr>
                        <td style="height: 26px">
                            <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="Exportar" Height="24px"
                                ImageAlign="Middle" ImageUrl="~/Images/excel.jpg" OnClick="ImageButton1_Click"
                                Width="24px" />
                        </td>
                        <td style="height: 26px">
                            <asp:Label ID="Label1" runat="server" Font-Size="Large" Text="Exportar "></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Label ID="lblError" runat="server" ForeColor="Red" Text="Label" Visible="False"></asp:Label></td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="sqlds_vwMonitoreoTickets"
                        AllowPaging="True" Width="968px" BorderWidth="1px" RowStyle-BackColor="#FFFFD6"
                        HeaderStyle-ForeColor="white" HeaderStyle-BackColor="#7189c4" BorderColor="#FFFFD6"
                        PageSize="25" AllowSorting="True" BorderStyle="Solid" OnRowDataBound="GridView1_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" DataFormatString="{0:d}"
                                HtmlEncode="False" />

                            <asp:BoundField DataField="TipoDocumento" HeaderText="Tipo de Documento" SortExpression="TipoDocumento" />
                            <asp:BoundField DataField="TipoUsuario" HeaderText="Tipo de Usuario" SortExpression="TipoUsuario" />
                            <asp:BoundField DataField="NumeroDocumento" HeaderText="Número de Documento" SortExpression="NumeroDocumento" />

                            
                            <asp:BoundField DataField="Ruc" HeaderText="Ruc" SortExpression="Ruc" />
                            <asp:BoundField DataField="Cliente" HeaderText="Cliente" ReadOnly="True" SortExpression="Cliente" />
                            <asp:BoundField DataField="Ticket" HeaderText="Ticket" ReadOnly="True" SortExpression="Ticket" />

                            <asp:BoundField DataField="Origen" HeaderText="Origen" ReadOnly="True" SortExpression="Origen" />

                            <asp:BoundField DataField="TipoServicio" HeaderText="Tipo De Servicio" ReadOnly="True"
                                SortExpression="TipoServicio" />
                            <asp:BoundField DataField="Estado" HeaderText="Estado" SortExpression="Estado" />
                            <asp:BoundField DataField="Cajero" HeaderText="Usuario" ReadOnly="True" SortExpression="Cajero" />
                            <asp:BoundField DataField="HoraEmision" HeaderText="Hora De Emision" ReadOnly="True"
                                SortExpression="HoraEmision" DataFormatString="{0:hh:mm:ss tt}" HtmlEncode="False" />
                            <asp:BoundField DataField="HoraAsignacion" HeaderText="Hora De Asignacion" ReadOnly="True"
                                SortExpression="HoraAsignacion" DataFormatString="{0:hh:mm:ss tt}" HtmlEncode="False" />
                            <asp:BoundField DataField="HoraInicioAtencion" HeaderText="Hora Inicio De Atenci&#243;n"
                                ReadOnly="True" SortExpression="HoraInicioAtencion" DataFormatString="{0:hh:mm:ss tt}" HtmlEncode="False" />
                            <asp:BoundField DataField="HoraFinAtencion" HeaderText="Hora Fin De Atenci&#243;n"
                                ReadOnly="True" SortExpression="HoraFinAtencion" DataFormatString="{0:hh:mm:ss tt}" HtmlEncode="False" />
                            <asp:BoundField DataField="TiempoEspera" HeaderText="Tiempo De Espera" ReadOnly="True"
                                SortExpression="TiempoEspera" />
                            <asp:BoundField DataField="TiempoAtencion" HeaderText="Tiempo De Atenci&#243;n" ReadOnly="True"
                                SortExpression="TiempoAtencion" />
                            <asp:BoundField DataField="TiempoPermanencia" HeaderText="Tiempo De Permanencia"
                                ReadOnly="True" SortExpression="TiempoPermanencia" />
                            <asp:BoundField DataField="Ventanilla" HeaderText="Ventanilla" SortExpression="Ventanilla" />
                        </Columns>
                        <PagerSettings Position="TopAndBottom" />
                        <PagerStyle HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFFFD6" />
                        <HeaderStyle BackColor="#7189C4" ForeColor="White" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <table align="center" style="font-family: Times New Roman" width="50%">
            <tr>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <font color="#808080" size="-2">Macrostudio</font>
                </td>
                <td>
                    <font color="#808080" size="-2">TVMedia®</font>
                </td>
                <td style="font-size: 12pt">
                    &nbsp;&nbsp;
                </td>
                <td style="font-size: 12pt">
                    <p align="right">
                        <a class="atras" href="javascript: history.back()"><font color="#000080"><span style="text-decoration: underline">
                            &lt;&lt;Atras</span></font></a></p>
                </td>
            </tr>
        </table>
        <asp:SqlDataSource ID="sqlds_vwMonitoreoTickets" runat="server" ConnectionString="<%$ ConnectionStrings:bdtvmediaSConnectionString %>"
            SelectCommand="SELECT * FROM [vw_MonitoreoTickets] WHERE (([Dni] LIKE '%' + @Dni + '%') AND ([Cliente] LIKE '%' + @Cliente + '%') AND ([Ruc] LIKE '%' + @Ruc + '%') AND ([Fecha] >= @FechaInicio)AND ([Fecha] <=@FechaFin))">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="%" Name="Dni" SessionField="Dni" Type="String" />
                <asp:SessionParameter DefaultValue="%" Name="Cliente" SessionField="Cliente" Type="String" />
                <asp:SessionParameter DefaultValue="%" Name="Ruc" SessionField="Ruc" Type="String" />
                <asp:SessionParameter DefaultValue="01/01/1900" Name="FechaInicio" SessionField="FechaInicio" />
                <asp:SessionParameter DefaultValue="31/12/2800" Name="FechaFin" SessionField="FechaFin" />
            </SelectParameters>
        </asp:SqlDataSource>
        &nbsp;
    </form>
</body>
</html>
